package com.sizu.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sizu.entity.TReturnList;
import com.sizu.mapper.TReturnListMapper;
import com.sizu.service.ITReturnListService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-03-16
 */
@Service
public class TReturnListServiceImpl extends ServiceImpl<TReturnListMapper, TReturnList> implements ITReturnListService {

    @Override
    public boolean upTReturnListState(String number) {
        Wrapper<TReturnList> tReturnListWrapper=new EntityWrapper<>();
        tReturnListWrapper.eq("return_number",number);
        TReturnList tReturnList=new TReturnList();
        tReturnList.setState(2);
        this.baseMapper.update(tReturnList,tReturnListWrapper);
        return true;
    }

    @Override
    public List<TReturnList> getTReturnList() {
        Wrapper<TReturnList> tReturnListWrapper=new EntityWrapper<>();
        tReturnListWrapper.eq("state","1");
        List<TReturnList> tReturnLists = this.baseMapper.selectList(tReturnListWrapper);
        return tReturnLists;
    }
}
